package org.datascooter.meta;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;

public class MetaIndex implements Serializable {

	private static final long serialVersionUID = -1130280182688544902L;
	public final String TABLE_CAT;
	public final String TABLE_SCHEM;
	public final boolean NON_UNIQUE;
	public final String INDEX_QUALIFIER;
	public final String INDEX_NAME;
	public final int TYPE;
	public final int ORDINAL_POSITION;
	public final String COLUMN_NAME;
	public final String ASC_OR_DESC;
	public final int CARDINALITY;
	public final int PAGES;
	public final String FILTER_CONDITION;

	public MetaIndex(ResultSet rs) throws SQLException {
		TABLE_CAT = rs.getString("TABLE_CAT");
		TABLE_SCHEM = rs.getString("TABLE_SCHEM");
		NON_UNIQUE = rs.getBoolean("NON_UNIQUE");
		INDEX_QUALIFIER = rs.getString("INDEX_QUALIFIER");
		INDEX_NAME = rs.getString("INDEX_NAME");
		TYPE = rs.getInt("TYPE");
		ORDINAL_POSITION = rs.getInt("ORDINAL_POSITION");
		COLUMN_NAME = rs.getString("COLUMN_NAME");
		ASC_OR_DESC = rs.getString("ASC_OR_DESC");
		CARDINALITY = rs.getInt("CARDINALITY");
		PAGES = rs.getInt("PAGES");
		FILTER_CONDITION = rs.getString("FILTER_CONDITION");
	}
}
